let text = 'mom and dad and baby';
let pattern = /mom( and dad( and baby))/gi;

let matches = pattern.exec(text);
console.log(matches.index);
console.log(matches);